-
Notifications
You must be signed in to change notification settings - Fork 283
Add Roberta converter #2124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Roberta converter #2124
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Here's the link to the testing colab - https://colab.research.google.com/github/omkar-334/keras-scripts/blob/main/RoBERTa_converter.ipynb Also, |
Hi @omkar-334. thanks for this PR. hf_model = TFRobertaModel.from_pretrained("roberta-base") while the Keras model is being quantized into model = keras_hub.models.RobertaBackbone.from_preset("hf://FacebookAI/roberta-base", dtype="bfloat16") It might be worth trying to load them in the same precision when verifying the logics. |
I did try to run your notebook by loading in both sets of weights as
|
This PR is stale because it has been open for 14 days with no activity. It will be closed if no further activity occurs. Thank you. |
This PR was closed because it has been inactive for 28 days. Please reopen if you'd like to work on this further. |
A few doubts -
Hugging Face’s RoBERTa uses 514 position embeddings (512 positions + 2 extra tokens), whereas Keras only expects 512.
Tokenizer comparison
